home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: division problem
- Date: 03 Feb 1996 16:55:31 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb3095531@qcd.lanl.gov>
- References: <31097D77.11AA@rain.org> <26JAN199622082450@erich.triumf.ca>
- <4eh246$u6h@airdmhor.gen.nz> <4ej4ha$66@fountain.mindlink.net>
- <DLzvGG.2rn@uns.bris.ac.uk>
- <Pine.SOL.3.90.960130150923.21923F-100000@flute>
- <4etjdj$fil@airdmhor.gen.nz> <mjs.823295100@hubcap>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: mjs@hubcap.clemson.edu's message of 2 Feb 96 21:05:00 GMT
-
- Note cross post to comp.std.c
-
- In article <mjs.823295100@hubcap> mjs@hubcap.clemson.edu
- (M. J. Saltzman) writes:
- <snip>
- >#if -3 / 2 == -2
- <snip>
- I'm not so sure. Is there a guarantee that the division as done in
- the compiler's preprocessing phase will give the same result as the
- division done at run time? Language lawyers?
-
- The standard seems silent as to this: except that it says that all
- integer arithmetic is done as on longs. The interpretation of character
- constants is explicitly permitted to be different. As otherwise the
- rules of expression evaluation are quoted, I would say other
- things cannot be different ... but I doubt whether that was intended.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-